#ifndef GRAPHICS_VERTEXBUFFER_H
#define GRAPHICS_VERTEXBUFFER_H
#include <core/core.h>
#include <core/object.h>
#include <core/ref.h>

class QGLShaderProgram;

namespace yam3d
{
namespace graphics
{

    class VertexArray;

    class VertexBuffer : public core::Object
    {
    public:
        VertexBuffer();
        virtual ~VertexBuffer();

        void addVertexArray( const char* const name, VertexArray* va );

        void setVertexArrays(QGLShaderProgram* program);

        const VertexArray* getVertexArray(  const char* const name ) const;
        VertexArray* getVertexArray(  const char* const name );
    private:
        typedef core::hash<core::string, core::Ref<VertexArray> > HashType;
        HashType m_vertexArrays;

        VertexBuffer(const VertexBuffer&);
        VertexBuffer& operator=(const VertexBuffer&);
    };
}
}

#endif // GRAPHICS_VERTEXBUFFER_H
